Eli Zaretskii [Mon, 26 Dec 2022 14:10:44 +0000 (16:10 +0200)]
; * etc/NEWS: Fix wording of a recently added entry.
Po Lu [Mon, 26 Dec 2022 07:57:06 +0000 (15:57 +0800)]
Redisplay "invisible" frames that are actually visible on modern X
* etc/NEWS: Document that "invisible" frames are now redisplayed
if the compositing manager is still displaying it as part of a
thumbnail out of Emacs's control.
* src/dispnew.c (Fredraw_display): Use FRAME_REDISPLAY_P.
* src/frame.h (FRAME_REDISPLAY_P): New macro.
* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(prepare_menu_bars, redisplay_internal, display_and_set_cursor)
(gui_clear_cursor): Use FRAME_REDISPLAY_P to determine whether
or not a frame should be redisplayed.
* src/xfns.c (Fx_create_frame): Set visibility state initially.
* src/xterm.c (handle_one_xevent): Likewise.
* src/xterm.h (struct x_output): New field `visibility_state'.
Stefan Kangas [Mon, 26 Dec 2022 05:30:21 +0000 (06:30 +0100)]
Merge from origin/emacs-29
6c00d126e7f Remove remaining mentions of 'eval-current-buffer'
1073e96170b ; * doc/lispref/text.texi (Database): Fix a typo. (Bug#6...
b1e68a33d89 Update to Org
9.6-61-g63e073f
dad73e4de19 ; Review and fix NEWS and related documentation
72786ae237e ; Restore ARGS argument in c-ts-mode--fontify-declarator
940ab2423ca ; Always consider :lisp-dir when locating main file of VC...
9ab98cd42aa Add heuristic to locate lisp code in source packages
dda011c78d1 ; * doc/lispref/parsing.texi (Tree-sitter major modes): F...
d62b634d8fc ; * src/process.c (Fprocess_running_child_p): Doc fix.
f6c5b3d635e ; * doc/lispref/parsing.texi: Add a reminder.
e6c49c0454e ; Fix byte-copmiler warning in c-ts-mode--fontify-declarator
4234033a47a ; * lisp/treesit.el: Add some comments.
79584a206b9 Further generalize treesit-defun functions
a819ca5a93c Generalize treesit-defun functions to "things"
e8b34109eeb Reorder optional arguments to 'package-vc-install'
b38e56d8a98 Handle missing dependencies for source packages
7bc7b6b4dd9 ; Partial revert of
f3e7820b
2cec78254ea ; * nt/INSTALL.W64: Fix wording.
ecee3bd4209 ; Fix recent changes in treesit documentation
# Conflicts:
# etc/NEWS
Gregory Heytings [Mon, 26 Dec 2022 01:21:16 +0000 (01:21 +0000)]
Remove remaining mentions of 'eval-current-buffer'
* lisp/emacs-lisp/edebug.el (edebug-all-defs):
* doc/lispref/eval.texi (Eval):
* doc/lispref/edebug.texi (Instrumenting, Edebug Options):
Remove remaining mentions of 'eval-current-buffer', obsoleted in
Emacs 22 and removed in Emacs 26.
Eli Zaretskii [Sun, 25 Dec 2022 17:43:49 +0000 (19:43 +0200)]
; * doc/lispref/text.texi (Database): Fix a typo. (Bug#60317)
Kyle Meyer [Sun, 25 Dec 2022 16:36:36 +0000 (11:36 -0500)]
Eli Zaretskii [Sun, 25 Dec 2022 12:54:33 +0000 (14:54 +0200)]
; Review and fix NEWS and related documentation
* etc/NEWS: Fix wording, punctuation, and markup.
* lisp/emacs-lisp/subr-x.el (string-glyph-split): Doc fix.
* doc/lispref/display.texi (Displaying Messages): Document
'set-message-functions'.
Juanma Barranquero [Sun, 25 Dec 2022 11:59:06 +0000 (12:59 +0100)]
; Restore ARGS argument in c-ts-mode--fontify-declarator
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator):
Restore argument name referenced in the docstring.
Philip Kaludercic [Sun, 25 Dec 2022 10:20:30 +0000 (11:20 +0100)]
; Always consider :lisp-dir when locating main file of VC packages
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Check the
:lisp-dir entry in the "extras" of a package description to find the
directory with a main file.
Philip Kaludercic [Sun, 25 Dec 2022 10:18:51 +0000 (11:18 +0100)]
Add heuristic to locate lisp code in source packages
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check if a
"lisp" directory exists and use that instead of PKG-DIR.
(Bug#60155)
Eli Zaretskii [Sun, 25 Dec 2022 09:34:12 +0000 (11:34 +0200)]
; * doc/lispref/parsing.texi (Tree-sitter major modes): Fix @cindex.
Eli Zaretskii [Sun, 25 Dec 2022 09:23:07 +0000 (11:23 +0200)]
; * src/process.c (Fprocess_running_child_p): Doc fix.
Yuan Fu [Sun, 25 Dec 2022 08:42:57 +0000 (00:42 -0800)]
; * doc/lispref/parsing.texi: Add a reminder.
Yuan Fu [Sun, 25 Dec 2022 08:29:15 +0000 (00:29 -0800)]
; Fix byte-copmiler warning in c-ts-mode--fontify-declarator
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator): Ignore
the rest args.
Yuan Fu [Sun, 25 Dec 2022 07:46:19 +0000 (23:46 -0800)]
; * lisp/treesit.el: Add some comments.
Yuan Fu [Sun, 25 Dec 2022 06:08:17 +0000 (22:08 -0800)]
Further generalize treesit-defun functions
Two new functions, treesit-beginning/end-of-thing. And
treesit-thing-at-point's signature changes.
* lisp/treesit.el (treesit-block-type-regexp): New variable.
(treesit-beginning-of-thing)
(treesit-end-of-thing): Generalized from
treesit-beginning/end-of-defun.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Use the new functions.
(treesit-thing-at-point): Accept PATTERN rather than REGEXP and PRED.
(treesit-defun-at-point): Adjust for the new signature of
treesit-thing-at-point.
Yuan Fu [Sun, 25 Dec 2022 04:17:08 +0000 (20:17 -0800)]
Generalize treesit-defun functions to "things"
Change the "defun" in some functions (e.g. treesit--defuns-around) to
"thing". Add a function treesit-thing-at-point.
* lisp/treesit.el (treesit--thing-unpack-pattern): New subroutine.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Use new function treesit--navigate-thing.
(treesit--defuns-around): Generalize into treesit--thing-around.
(treesit--top-level-defun): Generalize into treesit--top-level-thing.
(treesit--navigate-defun): Generalize into treesit--navigate-thing.
(treesit-thing-at-point): Generalized from treesit-defun-at-point.
(treesit-defun-at-point): Use treesit-thing-at-point to do tht work.
Philip Kaludercic [Sun, 25 Dec 2022 08:53:07 +0000 (09:53 +0100)]
Reorder optional arguments to 'package-vc-install'
* lisp/emacs-lisp/package-vc.el (package-vc-install-selected-packages):
Update 'package-vc-install' invocation.
(package-vc-install): Reorder and update documentation.
Philip Kaludercic [Sun, 25 Dec 2022 08:35:36 +0000 (09:35 +0100)]
Handle missing dependencies for source packages
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Add
new function.
(package-vc--unpack-1): Call 'package-vc-install-dependencies' instead
of 'package-compute-transaction' and 'package-download-transaction'.
It is unreasonable to abort the installation, since we cannot expect
all dependencies to be available in the regular archives. Instead we
note which packages couldn't be found, and warn the user that these
will be missing.
Philip Kaludercic [Mon, 19 Dec 2022 16:00:36 +0000 (17:00 +0100)]
; Partial revert of
f3e7820b
* lisp/emacs-lisp/package.el (package-install-from-archive): Check if
a package is a directory package, not a VC package
Eli Zaretskii [Sun, 25 Dec 2022 08:26:59 +0000 (10:26 +0200)]
; * nt/INSTALL.W64: Fix wording.
Eli Zaretskii [Sun, 25 Dec 2022 07:29:47 +0000 (09:29 +0200)]
; Fix recent changes in treesit documentation
* lisp/treesit.el (treesit-defun-name-function, treesit-node-at)
(treesit-node-on): Doc fixes.
* doc/lispref/parsing.texi (Tree-sitter major modes): Fix wording,
punctuation, and indexing.
(Retrieving Nodes): Fix wording and add cross-references.
Stefan Kangas [Sun, 25 Dec 2022 05:30:21 +0000 (06:30 +0100)]
Merge from origin/emacs-29
c36fe3df17b Fix c-ts-mode imenu defun name (bug#60296)
a24e350170e Fix treesit--children-covering-range-recurse (bug#60301)
fbb4eb919b4 Support treesit-defun-name in tree-sitter major modes
6253184afc2 ; * lisp/treesit.el (treesit-defun-at-point): Guard again...
f8e219ebfaa Add treesit-defun-name and friends
35c2ca2ca64 Make treesit-node-at/on guess language at point
7f7def2ae62 ; Add treesit-no-parser error
b6a2e1ddf66 * nt/INSTALL.W64: update instructions for setting up W64 ...
265b91d891a Revert "; Bump minimum supported Windows version for MinG...
75155e45860 ; Bump minimum supported Windows version for MinGW64 to W...
677f6c79eb9 ; Update minimum requirements of MinGW-w64
7723af5e4aa ; * lisp/progmodes/c-ts-mode.el: quote literal string in ...
38866510c7c ; * src/xdisp.c (redisplay_internal): Reinstate the FRAME...
a825aa0b135 Fix definition of CNS 11643-15 charset
a42b20dd95e ; * lisp/progmodes/c-ts-mode.el: Add outline section head...
e4e36345399 Improve c-ts-mode block comment indent (bug#60270)
e30621caa2c ; Add treesit_recursion_limit
6a43af58802 Fix block comment indent and filling for c-ts-mode (bug#5...
e492c21e810 Fix treesit_cursor_helper (bug#60267)
4437dbedf7b Fix restart-emacs alarms (Bug#60220)
121a9ff9f6f Fix alternate stack test in configure
84888080eea Add more functions to "string" shortdoc
c90f97d4e5d Make the Contour terminal an alias of xterm-256color
c3fac9465fa ; Fix punctuation in last change.
756bb422a49 Correct wrong info in (info)Go to node
a8c3424d28b Fix typo in TUTORIAL.fr (bug#60261)
24cd2f0daf1 Add some diff-fixup-modifs tests
d32091199ae Fix quoted argument in emacsclient-mail.desktop Exec key
286c48137f6 ert-x: Move window selection logic to its own macro
823c49cea85 ; ert-x: Simplify `ert-with-test-buffer-selected'
38c6abe4d0b ; ert-x: Add test for buffer read-only state
0e39ad6fa56 Fix crash after X error
Yuan Fu [Sun, 25 Dec 2022 02:59:39 +0000 (18:59 -0800)]
Fix c-ts-mode imenu defun name (bug#60296)
Extract out c-ts-mode--declarator-identifier from
c-ts-mode--fontify-declarator.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--declarator-identifier): New
function.
(c-ts-mode--fontify-defun): Extract out.
(c-ts-mode--defun-name): Use the new function.
Yuan Fu [Sun, 25 Dec 2022 02:45:36 +0000 (18:45 -0800)]
Fix treesit--children-covering-range-recurse (bug#60301)
* lisp/treesit.el (treesit--children-covering-range-recurse): Always
return a list of node.
Yuan Fu [Sun, 25 Dec 2022 02:24:01 +0000 (18:24 -0800)]
Support treesit-defun-name in tree-sitter major modes
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-name): New
function.
(csharp-ts-mode--imenu-1): Extract into new function.
(csharp-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--defun-name): New
function.
(java-ts-mode--imenu-1): Extract into new function.
(java-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/js.el (js-treesit-current-defun): Remove function.
This function is not used (for a while already).
(js--treesit-defun-name): New function.
(js--treesit-imenu-1): Extract into new function.
(js-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--defun-name): New
function.
(json-ts-mode--imenu-1): Extract into new function.
(json-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/python.el (python--treesit-defun-name): New function.
(python--imenu-treesit-create-index-1): Extract into new function.
(python-ts-mode): Setup treesit-defun-name-function.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--defun-name): New
function.
(rust-ts-mode--imenu-1): Extract into new function.
(rust-ts-mode): Setup treesit-defun-name-function.
* lisp/textmodes/css-mode.el (css--treesit-defun-name): New function.
(css--treesit-imenu-1): Extract into new function.
(css-ts-mode): Setup treesit-defun-name-function.
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode--get-table-name):
Remove function.
(toml-ts-mode--defun-name): New function.
(toml-ts-mode--imenu-1): Extract into new function.
(toml-ts-mode): Setup treesit-defun-name-function.
Yuan Fu [Sun, 25 Dec 2022 00:40:00 +0000 (16:40 -0800)]
; * lisp/treesit.el (treesit-defun-at-point): Guard against nil.
Yuan Fu [Sun, 25 Dec 2022 00:33:35 +0000 (16:33 -0800)]
Add treesit-defun-name and friends
1. We now have treesit-defun-name, powered by
treesit-defun-name-function.
2. We now have treesit-add-log-current-defun, which powers
add-log-current-defun.
3. c-ts-mode updates its code to take advantage of these new features.
4. Manual updates.
* doc/lispref/parsing.texi (Tree-sitter major modes): Add manual for
new functions.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-name): New function.
(c-ts-mode--imenu-1): Extract out into c-ts-mode--defun-name.
(c-ts-base-mode): Setup treesit-defun-name-function.
* lisp/treesit.el (treesit-defun-name-function)
(treesit-add-log-defun-delimiter): New variables.
(treesit-defun-at-point)
(treesit-defun-name): New functions.
(treesit-major-mode-setup): Setup add-log-current-defun-function.
Yuan Fu [Sat, 24 Dec 2022 23:31:03 +0000 (15:31 -0800)]
Make treesit-node-at/on guess language at point
If PARSER-OR-LANG is nil, it makes more sense to guess the language at
point by treesit-language-at than to simply use the first parser in
the parser list.
* doc/lispref/parsing.texi (Retrieving Nodes): Update manual.
* lisp/treesit.el (treesit-node-at)
(treesit-node-on): Guess language at point. Update docstring.
(treesit-buffer-root-node): Update docstring.
Yuan Fu [Sat, 24 Dec 2022 22:48:50 +0000 (14:48 -0800)]
; Add treesit-no-parser error
* lisp/treesit.el (treesit-no-parser): New error.
(treesit-buffer-root-node): Use the new error.
Óscar Fuentes [Sun, 25 Dec 2022 02:18:28 +0000 (03:18 +0100)]
* nt/INSTALL.W64: update instructions for setting up W64 environment
Eli Zaretskii [Sat, 24 Dec 2022 19:39:26 +0000 (21:39 +0200)]
Revert "; Bump minimum supported Windows version for MinGW64 to Windows 10."
This reverts commit
75155e458601a3597d382660d0be863ab4d512c0.
Evidently, some MSYS2/MinGW64 folks still think Windows 8.1
is the minimum supported version, even though MinGW-w64 switched
to Windows 10 as the default target in January 2022.
Eli Zaretskii [Sat, 24 Dec 2022 18:45:08 +0000 (20:45 +0200)]
; Bump minimum supported Windows version for MinGW64 to Windows 10.
Juri Linkov [Sat, 24 Dec 2022 18:04:56 +0000 (20:04 +0200)]
* lisp/tab-bar.el: Fix the recent removal of substring as a gv-place.
(tab-bar-auto-width): Copy more logic from 'cl--set-substring' (bug#60297).
Eli Zaretskii [Sat, 24 Dec 2022 16:46:58 +0000 (18:46 +0200)]
; Update minimum requirements of MinGW-w64
* etc/PROBLEMS (Dumping):
* nt/INSTALL.W64: Update the minimum OS version supported by
MinGW-w64.
Mattias Engdegård [Sat, 24 Dec 2022 16:01:36 +0000 (17:01 +0100)]
; * lisp/progmodes/c-ts-mode.el: quote literal string in regexp
Mattias Engdegård [Sat, 24 Dec 2022 09:39:57 +0000 (10:39 +0100)]
Fix condition-case empty success handler misinterpretation
(condition-case X E (:success)) should return nil; the compiler
behaves correctly in this case.
* src/eval.c (internal_lisp_condition_case):
Evaluate an empty :success handler as nil instead of pretending it
isn't there.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
Mattias Engdegård [Fri, 23 Dec 2022 19:04:22 +0000 (20:04 +0100)]
Fix condition-case body for-effect miscompilation
(condition-case x A (:success B)) should not compile A for-effect even
if the entire form is in for-effect context.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't optimise the condition-case body form for effect (potentially
discarding its value) if there is a success handler and a variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
Eli Zaretskii [Sat, 24 Dec 2022 10:27:17 +0000 (12:27 +0200)]
; * src/xdisp.c (redisplay_internal): Reinstate the FRAME_LIVE_P test.
Eli Zaretskii [Sat, 24 Dec 2022 10:08:43 +0000 (12:08 +0200)]
Fix definition of CNS 11643-15 charset
* lisp/international/mule-conf.el (chinese-cns11643-15): Fix
:code-offset value. (Bug#60275)
* lisp/international/characters.el: Add chinese-cns11643-15 to
charsets whose characters have categories c and C.
Paul Eggert [Sat, 24 Dec 2022 09:08:21 +0000 (01:08 -0800)]
Assume make-directory handler follows new API
Suggested by Michael Albinus (Bug#58919#56).
* lisp/files.el (files--ensure-directory): Omit recently-added arg
MKDIR, since it is now always make-directory again. All uses
changed.
(make-directory): Assume the make-directory handler follows the
new API where it yields non-nil if DIR already exists. This
reverts some of the recent changes in this area, and simplifies
this funciton.
Yuan Fu [Sat, 24 Dec 2022 08:16:45 +0000 (00:16 -0800)]
; * lisp/progmodes/c-ts-mode.el: Add outline section headers.
Yuan Fu [Sat, 24 Dec 2022 08:15:48 +0000 (00:15 -0800)]
Improve c-ts-mode block comment indent (bug#60270)
Now it handles stuff like
/**
* @some_func:
* @arg1:
*/
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Use new
matcher and anchor.
(c-ts-mode--looking-at-star): New matcher.
(c-ts-mode--comment-start-after-first-star): New anchor.
Yuan Fu [Sat, 24 Dec 2022 01:17:25 +0000 (17:17 -0800)]
; Add treesit_recursion_limit
* src/treesit.c (treesit_recursion_limit): New constant.
(treesit_cursor_helper)
(Ftreesit_search_subtree)
(Ftreesit_induce_sparse_tree): Use the new constant.
Yuan Fu [Sat, 24 Dec 2022 01:12:32 +0000 (17:12 -0800)]
Fix block comment indent and filling for c-ts-mode (bug#59763)
Now indent and filling works like in c-mode. The only noticeable
missing piece is that the "*/" is not attached to the last sentence
when filling. c-mode does it by replacing whitespaces between the
"*/" and the end of the last sentence with xxx, fill it, then change
the xxx back. I don't know if we should do that in c-ts-mode's filling.
* doc/lispref/modes.texi (Parser-based Indentation): Add new preset.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add new
indent rule.
(c-ts-mode--fill-paragraph): New function.
(c-ts-base-mode): Setup paragraph-start, adaptive-fill, etc.
* lisp/treesit.el (treesit-simple-indent-presets): Add new preset.
Yuan Fu [Fri, 23 Dec 2022 23:22:31 +0000 (15:22 -0800)]
Fix treesit_cursor_helper (bug#60267)
The cause of that bug is that in a particular parse tree, the node
treesit_cursor_helper tries to go to is a missing node, not only is it
a missing node, it is the first node of a subtree. So when
treesit_cursor_helper follows the algorithm and goes down the tree, it
goes down the previous subtree (because that subtree's end = end_pos,
because the target node has zero width).
o
|
o--+-o
| |
+-+ +-+-+
| | | | |
o x t o o
(We ended up in x when the target is t, because t has zero width.)
One way to solve it is to go back up the tree if we are at a leaf node
and still haven't matched the target node. That's too ugly and
finicky so I resorted to recursion. Now one more functions will
return give up (treesit_node_parent) if we are in a werid parse tree
that is super deep. But since we already kind of give up on this kind
of parse trees (bug#59426), it doesn't really hurt.
* src/treesit.c (treesit_cursor_helper_1): New function.
(treesit_cursor_helper): Use the new function. Change return type to
bool, and accept a cursor pointer.
(Ftreesit_node_parent)
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Use the new signature.
Paul Eggert [Sat, 24 Dec 2022 07:36:06 +0000 (23:36 -0800)]
Fix restart-emacs alarms (Bug#60220)
* src/emacs.c (Fkill_emacs): Turn timers off before execing,
so that the re-execed Emacs doesn’t get a timer alarm.
Florian Weimer [Fri, 23 Dec 2022 17:49:25 +0000 (18:49 +0100)]
configure: Remove obsolete check for -b i486-linuxaout
If there are still a.out system arounds, they shouldn't need this
anymore because the toolchain has been fixed.
* configure.ac (emacs_cv_b_link): Remove obsolete check.
Florian Weimer [Fri, 23 Dec 2022 17:51:08 +0000 (18:51 +0100)]
Fix alternate stack test in configure
* configure.ac (emacs_cv_alternate_stack): Include <stdlib.h>
for 'malloc's prototype.
Xi Lu [Fri, 23 Dec 2022 15:50:39 +0000 (23:50 +0800)]
Add more functions to "string" shortdoc
* lisp/emacs-lisp/shortdoc.el: Add 'string-or-null-p',
'char-or-string-p', 'char-uppercase-p'. (Bug#60279)
Yaraslau Tamashevich [Fri, 23 Dec 2022 09:39:25 +0000 (11:39 +0200)]
Make the Contour terminal an alias of xterm-256color
* lisp/faces.el (term-file-aliases): Make the Contour terminal an
alias of xterm-256color. (Bug#60278)
Copyright-paperwork-exempt: yes
Eli Zaretskii [Sat, 24 Dec 2022 07:40:56 +0000 (09:40 +0200)]
; Fix punctuation in last change.
glacials [Thu, 22 Dec 2022 20:09:08 +0000 (12:09 -0800)]
Correct wrong info in (info)Go to node
The node (info)Go to node in the Info manual states that 'g'
does not allow the use of abbreviations, however it does.
To test this, type 'gt' from this node and see that it takes
you to (info)Top, then type 'ggo<RET>' and see that it takes
you back to (info)Go to node. Tested on emacs 28.2.
* doc/misc/info.texi (Go to node): Fix inaccurate information.
(Bug#60263)
Copyright-paperwork-exempt: yes
Eli Zaretskii [Sat, 24 Dec 2022 07:32:08 +0000 (09:32 +0200)]
Fix typo in TUTORIAL.fr (bug#60261)
* etc/tutorials/TUTORIAL.fr: Fix typo. Reported by
Clément Escude--Cotinat <clement.escudecotinat@yahoo.fr>.
Daniel Martín [Thu, 22 Dec 2022 18:10:24 +0000 (19:10 +0100)]
Add some diff-fixup-modifs tests
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-fixups-added-lines):
Test that diff-mode fixes patches with added lines correctly.
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-fixups-empty-hunks):
Ditto for patches with empty hunks. (Bug#60259)
Paul Eggert [Sat, 24 Dec 2022 07:15:52 +0000 (23:15 -0800)]
Update from Gnulib by running admin/merge-gnulib
Ulrich Müller [Mon, 19 Dec 2022 15:51:20 +0000 (16:51 +0100)]
Fix quoted argument in emacsclient-mail.desktop Exec key
Apparently the emacsclient-mail.desktop file doesn't conform to the
Desktop Entry Specification at
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
which says about the Exec key:
| Field codes must not be used inside a quoted argument, the result of
| field code expansion inside a quoted argument is undefined.
However, the %u field code is used inside a quoted argument of the
Exec key in both the [Desktop Entry] and [Desktop Action new-window]
sections.
* etc/emacsclient-mail.desktop (Exec): The Desktop Entry
Specification does not allow field codes like %u inside a quoted
argument. Work around it by passing %u as first parameter ($1)
to the shell wrapper.
* etc/emacsclient.desktop (Exec): Use `sh` rather than `placeholder`
as the command name of the shell wrapper. (Bug#60204)
Richard Hansen [Sat, 17 Dec 2022 23:51:33 +0000 (18:51 -0500)]
ert-x: Move window selection logic to its own macro
* lisp/emacs-lisp/ert-x.el (ert-with-buffer-selected): New macro to
temporarily display a buffer in a selected window and evaluate a body.
(ert-with-test-buffer-selected): Use the new macro.
* test/lisp/whitespace-tests.el
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value): Add tests.
(Bug#60189)
Richard Hansen [Sat, 17 Dec 2022 23:18:39 +0000 (18:18 -0500)]
; ert-x: Simplify `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected):
Simplify using 'ert-with-test-buffer'. (Bug#60189)
Richard Hansen [Sat, 17 Dec 2022 23:26:33 +0000 (18:26 -0500)]
; ert-x: Add test for buffer read-only state
This test should have been included with commit
29b7d740006fe2190a729bd1c30ccab9356cee36.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-test-with-test-buffer-selected/read-only): New test.
(Bug#60189)
Po Lu [Sat, 24 Dec 2022 06:19:46 +0000 (14:19 +0800)]
; * src/xterm.c (x_error_quitter): Fix typo.
Po Lu [Sat, 24 Dec 2022 06:12:17 +0000 (14:12 +0800)]
Print out more X error details
* src/xterm.c (x_error_quitter): Print the failing resource ID
and minor code on an X error.
Po Lu [Sat, 24 Dec 2022 06:14:51 +0000 (14:14 +0800)]
Fix crash after X error
* src/xdisp.c (redisplay_internal): Catch another crash if
gcscrollbars after an X error.
Stefan Kangas [Sat, 24 Dec 2022 05:30:29 +0000 (06:30 +0100)]
Merge from origin/emacs-29
9a3b08061fe Fix ruby-mode.el local command injection vulnerability (b...
4b44a395b3c ; * etc/NEWS: Fix typos.
458e1752701 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
eccb813a943 Fix "C-h k" in recursive minibuffers
6dda2106ece ; Improve documentation of "C-x @"
a0738e8ad13 ; * etc/NEWS: Announce the new behavior of 'C-h f'. (Bug...
86b11981b0d Update Tramp version (don't merge with master)
# Conflicts:
# etc/NEWS
Stefan Kangas [Sat, 24 Dec 2022 05:30:28 +0000 (06:30 +0100)]
; Merge from origin/emacs-29
The following commit was skipped:
86b11981b0d Update Tramp version (don't merge with master)
Sean Whitton [Fri, 23 Dec 2022 03:54:08 +0000 (20:54 -0700)]
vc-git-checkin: Stash other staged changes
* lisp/vc/vc-git.el (vc-git--stash-staged-changes): New function.
(vc-git-checkin): Use new function to avoid needing to unstage changes
unrelated to the patch we want to commit (bug#60126).
Xi Lu [Fri, 23 Dec 2022 04:52:48 +0000 (12:52 +0800)]
Fix ruby-mode.el local command injection vulnerability (bug#60268)
* lisp/progmodes/ruby-mode.el
(ruby-find-library-file): Fix local command injection vulnerability.
Michael Albinus [Fri, 23 Dec 2022 18:29:37 +0000 (19:29 +0100)]
; * etc/NEWS: Fix typos.
Michael Albinus [Fri, 23 Dec 2022 17:36:08 +0000 (18:36 +0100)]
Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29
Stefan Kangas [Fri, 23 Dec 2022 17:21:10 +0000 (18:21 +0100)]
; Fix typos
Eli Zaretskii [Fri, 23 Dec 2022 14:41:08 +0000 (16:41 +0200)]
Fix "C-h k" in recursive minibuffers
* lisp/subr.el (event--posn-at-point): Leave POSN alone if it
doesn't have at least 6 members. This follows more faithfully
what 'event-start' and 'event-end' did before they started using
this function, see commit
c1cead89f5f. Call posn-at-point with
the minibuffer-window when in the minibuffer. (Bug#60252)
Eli Zaretskii [Fri, 23 Dec 2022 12:37:04 +0000 (14:37 +0200)]
; Improve documentation of "C-x @"
* doc/emacs/custom.texi (Modifier Keys): Document how to enter
Shift, Control, and Meta using "C-x @".
* lisp/simple.el (function-key-map): Add commentary to "C-x @"
bindings to make them easier to discover.
Eli Zaretskii [Fri, 23 Dec 2022 11:32:18 +0000 (13:32 +0200)]
; * etc/NEWS: Announce the new behavior of 'C-h f'. (Bug#60252)
Po Lu [Fri, 23 Dec 2022 10:05:44 +0000 (18:05 +0800)]
Speed up completion plugins over slow networks
* src/xterm.c (x_make_frame_invisible): Do not sync if
`x-lax-frame-positioning' is enabled.
(syms_of_xterm): Update doc string.
Paul Eggert [Fri, 23 Dec 2022 06:40:23 +0000 (22:40 -0800)]
Leap seconds are planned to go away by the year 2035.
Stefan Kangas [Fri, 23 Dec 2022 05:30:12 +0000 (06:30 +0100)]
; Merge from origin/emacs-29
The following commits were skipped:
5a34e7c86ca ; * admin/notes/git-workflow: Adding "Backport:" is optio...
baaa9f42e57 vc-git-checkin: Don't try to apply an empty patch
Stefan Kangas [Fri, 23 Dec 2022 05:30:12 +0000 (06:30 +0100)]
Merge from origin/emacs-29
0754173c923 ; Fix docstring
014232d3840 Eglot: eglot--servers-by-xrefed-file doesn't need to be v...
bbe35c280c2 Prevent stale servers when using eglot-extend-to-xref
9bf13a3fb9e ; * src/alloc.c (Fmemory_info): Doc fix.
baa33a5c054 * etc/tutorials/TUTORIAL.cn: Fix typos. (Bug#60221)
98d7f76b451 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
a488a6870ac Add alias for removed font-lock function
02e046566e2 Set beginning/end-of-defun-function in treesit-major-mode...
7dea58b88db Add treesit-defun-at-point and fix c-ts-mode-indent-defun
69123d4aa4e ; Fix treesit--defuns-around
05d8310fb5d Use the new keyword ':repeat' in repeatable keymaps.
Sean Whitton [Thu, 22 Dec 2022 20:38:48 +0000 (13:38 -0700)]
; * admin/notes/git-workflow: Adding "Backport:" is optional.
Sean Whitton [Tue, 20 Dec 2022 22:53:19 +0000 (15:53 -0700)]
vc-git-checkin: Don't try to apply an empty patch
* lisp/vc/vc-git.el (vc-git-checkin): Don't try to apply an empty
patch to the index, because in that case 'git apply' fails.
(cherry picked from commit
1424342225ef5b18c630364dd88e004f4ebb1c7f)
Jim Porter [Tue, 20 Dec 2022 21:47:20 +0000 (13:47 -0800)]
Simplify handling of /dev/null redirection in Eshell
This also fixes an issue where "echo hi > foo > /dev/null" didn't
write to the file "foo". (Note that users can still use their
system's null device name when redirecting; Eshell doesn't need to do
anything special to support that.)
* lisp/eshell/esh-io.el (eshell-virtual-targets): Add "/dev/null".
(eshell-set-output-handle): Handle 'eshell-null-device'.
* test/lisp/eshell/esh-io-tests.el
(esh-io-test/redirect-subcommands/dev-null)
(esh-io-test/virtual/dev-null, esh-io-test/virtual/dev-null/multiple):
New tests.
Jim Porter [Tue, 20 Dec 2022 17:39:07 +0000 (09:39 -0800)]
Fix handling of output handles in nested Eshell forms
Previously, the output handles in nested forms would be reset to the
default, leading to wrong behavior for commands like
{echo a; echo b} > file
"b" would be written to "file" as expected, but "a" would go to
standard output (bug#59545).
* lisp/eshell/esh-cmd.el (eshell-parse-command): Use
'eshell-with-copied-handles' for each statement within the whole
Eshell command.
* test/lisp/eshell/esh-io-tests.el (esh-io-test/redirect-subcommands)
(esh-io-test/redirect-subcommands/override)
(esh-io-test/redirect-subcommands/interpolated): New tests.
* test/lisp/eshell/em-script-tests.el
(em-script-test/source-script/redirect)
(em-script-test/source-script/redirect/dev-null): New tests.
(em-script-test/source-script, em-script-test/source-script/arg-vars)
(em-script-test/source-script/all-args-var): Tweak names/docstrings.
* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest):
Skip over the newly-added 'eshell-with-copied-handles' form when
checking the parse results.
* test/lisp/eshell/em-tramp-tests.el (em-tramp-test/su-default)
(em-tramp-test/su-user, em-tramp-test/su-login)
(em-tramp-test/sudo-shell, em-tramp-test/sudo-user-shell)
(em-tramp-test/doas-shell, em-tramp-test/doas-user-shell): Update
expected command forms.
Jim Porter [Tue, 20 Dec 2022 06:21:10 +0000 (22:21 -0800)]
Add 'eshell-duplicate-handles' to return a copy of file handles
* lisp/eshell/esh-io.el (eshell-create-handles): Support creating with
multiple targets for stdout and/or stderr. Make the targets for a
handle always be a list, and store whether the targets are the default
in a separate 'default' field.
(eshell-protect-handles, eshell-close-handles)
(eshell-copy-output-handle, eshell-interactive-output-p)
(eshell-output-object): Update for changes in 'eshell-create-handles'.
(eshell-duplicate-handles, eshell-get-targets): New functions.
* lisp/eshell/esh-cmd.el (eshell-copy-handles): Rename and alias to...
(eshell-with-copied-handles): ... this function, and use
'eshell-duplicate-handles'.
(eshell-execute-pipeline): Use 'eshell-duplicate-handles'.
Michael Albinus [Thu, 22 Dec 2022 18:39:59 +0000 (19:39 +0100)]
Handle make-directory return values in file name handlers
* lisp/net/ange-ftp.el (ange-ftp-make-directory): Handle return
values.
* lisp/net/tramp.el (tramp-skeleton-make-directory): New defmacro.
Handle also return values.
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
* lisp/net/tramp-crypt.el (tramp-crypt-handle-make-directory):
* lisp/net/tramp-fuse.el (tramp-fuse-handle-make-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-directory):
Use it.
* test/lisp/net/tramp-tests.el (tramp-test13-make-directory):
Handle return values.
Ikumi Keita [Thu, 22 Dec 2022 17:23:34 +0000 (18:23 +0100)]
; Fix docstring
* lisp/textmodes/reftex-vars.el
(reftex-allow-detached-macro-args): Fix macro name in docstring.
Michael Albinus [Thu, 22 Dec 2022 15:46:00 +0000 (16:46 +0100)]
Update Tramp version (don't merge with master)
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.6.0.29.1".
(customize-package-emacs-version-alist):
Adapt Tramp version integrated in Emacs 29.1.
João Távora [Thu, 22 Dec 2022 15:44:11 +0000 (15:44 +0000)]
Eglot: eglot--servers-by-xrefed-file doesn't need to be value-weak
* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Doesn't
need to be weak.
João Távora [Thu, 22 Dec 2022 11:29:49 +0000 (11:29 +0000)]
Prevent stale servers when using eglot-extend-to-xref
A weak-valued hash-table is not enough to guarantee that a reference
to a zombie server in eglot--servers-by-xrefed-file variable won't
survive long enough to confuse the next call to eglot--current-server
in some buffers.
So, before this fix it was common to get "Process EGLOT ... not
running" errors if some xref-extended buffers (like system libraries)
were open and M-x eglot-reconnect was issued. This should be
prevented now.
Note however, that even after this the eglot-extend-to-xref logic is
still flawed. For example, if a buffer for the xref-extended buffer
happens to be already visited by the time M-. is issued to navigate to
it, Eglot won't be activated. A half-decent workaround is to kill the
buffer and re-visit it.
* lisp/progmodes/eglot.el (eglot--servers-by-xrefed-file): Move
up.
(eglot--on-shutdown): Make sure to cleanup
eglot--servers-by-xrefed-file.
Eli Zaretskii [Thu, 22 Dec 2022 11:02:45 +0000 (13:02 +0200)]
; * src/alloc.c (Fmemory_info): Doc fix.
Xi Lu [Tue, 20 Dec 2022 15:19:13 +0000 (23:19 +0800)]
* etc/tutorials/TUTORIAL.cn: Fix typos. (Bug#60221)
Eli Zaretskii [Thu, 22 Dec 2022 09:00:41 +0000 (11:00 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Benson Chu [Wed, 21 Dec 2022 23:41:32 +0000 (17:41 -0600)]
Add alias for removed font-lock function
As part of
18947103fabf8070738b3bd9c5a8d02f90988a3d,
`font-lock-fontify-syntactically-region' was renamed to
`font-lock-default-fontify-sytactically'.
* lisp/font-lock.el (font-lock-fontify-syntactically-region): Add
obsolete alias for the renamed function.
Copyright-paperwork-exempt: yes
Yuan Fu [Thu, 22 Dec 2022 08:41:58 +0000 (00:41 -0800)]
Set beginning/end-of-defun-function in treesit-major-mode-setup
* lisp/treesit.el (treesit-major-mode-setup): Set them.
Yuan Fu [Wed, 21 Dec 2022 05:22:30 +0000 (21:22 -0800)]
Add treesit-defun-at-point and fix c-ts-mode-indent-defun
* lisp/treesit.el (treesit-defun-at-point): New function.
* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-defun): Implement with
treesit-defun-at-point.
Yuan Fu [Wed, 21 Dec 2022 05:21:48 +0000 (21:21 -0800)]
; Fix treesit--defuns-around
Now it doesn't move point.
* lisp/treesit.el (treesit--defuns-around): Wrap some code with
save-excursion.
Juri Linkov [Thu, 22 Dec 2022 08:03:09 +0000 (10:03 +0200)]
Use the new keyword ':repeat' in repeatable keymaps.
* lisp/bindings.el (undo-repeat-map)
(buffer-navigation-repeat-map, next-error-repeat-map)
(page-navigation-repeat-map):
* lisp/comint.el (comint-repeat-map):
* lisp/dired.el (dired-jump-map):
* lisp/outline.el (outline-navigation-repeat-map)
(outline-editing-repeat-map):
* lisp/shell.el (shell-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map):
* lisp/winner.el (winner-repeat-map):
* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map):
* lisp/eshell/esh-mode.el (eshell-command-repeat-map):
Add the keyword ':repeat' to 'defvar-keymap' instead of
setting the symbol property 'repeat-map' explicitly.
* lisp/keymap.el (defvar-keymap): Check for 'props'
that is used in 'defvar-form'.
Po Lu [Thu, 22 Dec 2022 07:50:12 +0000 (15:50 +0800)]
Simplify X premultipled pixel allocation code
* src/xterm.c (x_premultiply_pixel): New function.
(x_query_colors): Improve documentation.
(x_draw_fringe_bitmap, x_query_frame_background_color): Use
x_premultiply_pixel.
Stefan Kangas [Thu, 22 Dec 2022 05:30:10 +0000 (06:30 +0100)]
; Merge from origin/emacs-29
The following commit was skipped:
d6c8d5dbc9f When redirecting in Eshell, check for "/dev/null" specifi...
Stefan Kangas [Thu, 22 Dec 2022 05:30:09 +0000 (06:30 +0100)]
Merge from origin/emacs-29
e59216d3be8 * Invoke spawed Emacs processes with '-Q' when native com...
777b383dd0f Fix Eshell electric slash when used from the root directo...
c088cdad9e9 Fix the --without-all build with tree-sitter
ec9fbad908d Fix write-region to null device on MS-Windows
f35da111990 message: Do not default to eudc-capf-complete yet
98c16a8c883 ; * lisp/tab-bar.el: Remaining renaming of "fixed-width" ...
d76d7a3bebf whitespace: Avoid mutating original buffer's markers in c...
Jim Porter [Wed, 21 Dec 2022 00:20:50 +0000 (16:20 -0800)]
When redirecting in Eshell, check for "/dev/null" specifically
This is so that users can type "cmd ... > /dev/null" in Eshell no
matter what their system's null device is called. (Users can still
use their system's null device name when redirecting, too. Eshell
doesn't need to do anything special to support that.) This partially
reverts
67a8bdb90c9b5865b7f17290c7135b1a5458c36d. See bug#59545.
Do not merge to master.
* lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null"
literally.
Andrea Corallo [Wed, 21 Dec 2022 22:26:52 +0000 (23:26 +0100)]
* Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
* lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'.
(comp-run-async-workers): Likewise.